<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
	<title>木投网--个人中心--资源单管理</title>
	<link rel="stylesheet" href="/resource/css/mt_index.css">
	<link rel="stylesheet" href="/resource/css/mt_user.css">
	<link rel="stylesheet" href="/resource/css/mt_showBo.css">
</head>
<body>
@include("common.shop_user_head")
		<div class="user-cont left">
			<div class="user-title">资源单管理</div>
			<div class="resource">
				<!-- 资源单管理 -->
				<div class="table" id="list">
					<table>
						<thead>
							<tr>
								<th width="90px">商品标题</th>
								<th width="110px">规格</th>
								<th width="120px">库存量</th>
								<th width="100px">起订量</th>
								<th width="140px">价格</th>
								<th width="100px">发布时间</th>
								<th width="90px">状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
						@foreach($list as $v)
							<tr>
								<td>{{$v->product_name}}</td>
								<td>{{$v->spec}}</td>
								<td>{{$v->stock}}{{$v->unit}}</td>
								<td>{{$v->start_num}}{{$v->unit}}</td>
								<td><span>￥{{$v->price}}/{{$v->unit}}</span></td>
								<td>{{date('Y-m-d',$v->created)}}</td>
								<td >@if($v->status == 1)<span style="color:green;">审核通过</span> @elseif($v->status == 2)<span style="color:#f08300;">审核中</span> @else <span style="color:red;">审核未通过</span> @endif</td>
								<td><a href="javascript:;" data-product_id="{{ $v->product_id }}" class="delete">删除</a></td>
							</tr>
						@endforeach
						</tbody>
					</table>
				</div>
				{{$list->links()}}
			</div>
		</div>

@include("common.shop_user_foot")

<script src="/resource/js/jquery-1.11.3.min.js"></script>
<script src="/resource/js/mt_index.js"></script>
<script src="/resource/js/mt_showBo.js"></script>  <!-- 提示信息 -->
<script src="/resource/js/T.js"></script>

<script>
	//点击删除
	$(document).delegate('.delete','click',function(){
		var data = $(this).data();
		Showbo.Msg.confirm('<img class="left" src="/resource/img/user_if.png" alt=""><span style="float:left;font-size:22px;">确定删除该资源单？</span>',function(btn){
			if (btn == 'yes') {
				T.restPost('/new_resource_delete', data, function (response) {
					if (response.data.state) {
						T.ajaxLoad('/new_resource_ajax', 'list', function () {
						});
					} else {
						alert("刪除失敗");
					}
				});
			}else{
				return false;
			};
		});
	});
</script>
</body>
</html>